package main

import "fmt"

type Usber interface {
	Start()
	Stop()
	work()
}
type Computer struct {
}

func (c Computer) work(usb Usber) {
	usb.Start()
	usb.Stop()
}

type Phone struct {
	Name string
}
type Camera struct {
	Name      string
	PhotoTime string
}

func (p Phone) Start() {
	fmt.Println(p.Name, "正在开机....")
}
func (p Phone) Stop() {
	fmt.Println(p.Name, "5秒后自动关闭")
}
func (p Camera) Start() {
	fmt.Println(p.Name, "按下了拍照键....")
}

func (p Camera) Stop() {
	fmt.Println(p.Name, "拍照完毕,时间:", p.PhotoTime)
}
func main() {
	c := Computer{}
	p := Phone{
		Name: "vivo手机",
	}
	ca := Camera{
		Name:      "大型单反相机",
		PhotoTime: "1998-2-21 20:10:30",
	}
	c.work(p)
	c.work
	p.Start()
	p.Stop()
	ca.Start()
	ca.Stop()
	// c.work(p.Start())
	// c.work(p.Stop())
	// c.work(ca.Start())
	// c.work(ca.Stop())
}
